<%--
  Created by IntelliJ IDEA.
  User: 王德明
  Date: 2018/5/15
  Time: 17:22
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>

<div class="animated fadeInRight">
    <div class="wrapper wrapper-content ng-scope">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>{{ 'ABNORMAL'| translate }}</h5>
                    </div>
                    <div class="ibox-content sk-loading" ng-controller="operationAbnormalCtrl">
                        <div class="sk-spinner sk-spinner-wave">
                            <div class="sk-rect1"></div>
                            <div class="sk-rect2"></div>
                            <div class="sk-rect3"></div>
                            <div class="sk-rect4"></div>
                            <div class="sk-rect5"></div>
                        </div>

                        <form name="myform" serializer="searchAbnormal(searchInfo)">
                            <div class="row">
                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                                <span class="input-group-addon">平台订单号：</span>
                                                <input type="text" id="orderId" class="form-control" ng-model="searchInfo.orderId">
                                        </div>
                                    </div>
                                </div>

                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">商户号：</span>
                                            <select class="form-control b-r-sm" id="merId" ng-model="searchInfo.merId"
                                                    ng-options="x.id as x.id + '(' + x.name + ')' for x in merchants">
                                            </select>
                                            <%--<div uib-tooltip="可通过商户名称搜索商户号"--%>
                                                 <%--angucomplete-alt id="merId"--%>
                                                 <%--input-name="merId"--%>
                                                 <%--maxlength="10"--%>
                                                 <%--pause="100"--%>
                                                 <%--auto-match="true"--%>
                                                 <%--selected-object="selectedMerchant"--%>
                                                 <%--local-data="merchants"--%>
                                                 <%--search-fields="id,name"--%>
                                                 <%--title-field="id"--%>
                                                 <%--description-field="name"--%>
                                                 <%--minlength="0"--%>
                                                 <%--focus-first="true"--%>
                                                 <%--input-class="form-control form-control-small"--%>
                                                 <%--match-class="highlight">--%>
                                            <%--</div>--%>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">域名：</span>
                                            <select class="form-control b-r-sm" id="siteId" ng-model="searchInfo.siteId"
                                                    ng-options="x.id as x.siteUrl for x in siteUrls">
                                            </select>
                                            <%--<div uib-tooltip="未选择商户请输入至少三位关键字，可直接输入商户号搜索域名，若商户不存在则不可输入！"--%>
                                                 <%--angucomplete-alt id="mer_web"--%>
                                                 <%--input-name="siteId"--%>
                                                 <%--maxlength="40"--%>
                                                 <%--pause="100"--%>
                                                 <%--auto-match="true"--%>
                                                 <%--selected-object="selectedWeb"--%>
                                                 <%--local-data="siteUrls"--%>
                                                 <%--search-fields="merId,siteUrl"--%>
                                                 <%--title-field="siteUrl"--%>
                                                 <%--description-field="merId"--%>
                                                 <%--minlength="minText"--%>
                                                 <%--focus-first="true"--%>
                                                 <%--input-class="form-control form-control-small"--%>
                                                 <%--match-class="highlight"--%>
                                                 <%--disable-input="webDisable">--%>
                                            <%--</div>--%>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">申请人：</span>
                                            <input type="text" id="applicant" class="form-control" ng-model="searchInfo.applicant">
                                        </div>
                                    </div>
                                </div>

                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">申请起始日期：</span>
                                            <input type="text" id="auditBeginDate"
                                                   uib-tooltip="可只选择起始日期查询起始日期至今订单"
                                                   class="form-control" ng-readonly="true" ng-click="openDatepicker1()"
                                                   uib-datepicker-popup="{{format}}" ng-model="searchInfo.auditBeginDate"
                                                   is-open="popup1.opend"
                                                   datepicker-options="dateOptions1"
                                                   alt-input-formats="altInputFormats"
                                                   close-text="关闭"
                                                   clear-text="清空"
                                                   current-text="今天">
                                            <span class="input-group-btn">
                                            <button type="button" class="btn btn-default btn-sm no-margins"
                                                    ng-click="openDatepicker1()">
                                                <i class="fa fa-calendar"></i>
                                            </button>
                                        </span>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">申请结束日期：</span>
                                            <input type="text" id="auditEndDate"
                                                   class="form-control" ng-readonly="true" ng-click="openDatepicker2()"
                                                   uib-datepicker-popup="{{format}}" ng-model="searchInfo.auditEndDate"
                                                   is-open="popup2.opend"
                                                   datepicker-options="dateOptions2"
                                                   alt-input-formats="altInputFormats"
                                                   ng-disabled="auditEndDateDisable"
                                                   close-text="关闭"
                                                   clear-text="清空"
                                                   current-text="今天">
                                            <span class="input-group-btn">
                                            <button type="button" class="btn btn-default btn-sm no-margins"
                                                    ng-click="openDatepicker2()"
                                                    ng-disabled="auditEndDateDisable">
                                                <i class="fa fa-calendar"></i>
                                            </button>
                                        </span>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">异常状态：</span>
                                            <select  class="form-control" id="exceptionstatus" ng-model="searchInfo.exceptionstatus">
                                                <option value=""></option>
                                                <option  ng-repeat="x in exceptionstatus" value="{{ x.firstValue }}">
                                                    {{ x.name }}
                                                </option>
                                            </select>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">审核人：</span>
                                            <input type="text" class="form-control" id="reviewer" ng-model="searchInfo.reviewer">
                                        </div>
                                    </div>
                                </div>

                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">审核起始日期：</span>
                                            <input type="text" id="BeginDate"
                                                   uib-tooltip="可只选择起始日期查询起始日期至今订单"
                                                   class="form-control" ng-readonly="true" ng-click="openDatepicker3()"
                                                   uib-datepicker-popup="{{format}}" ng-model="searchInfo.BeginDate"
                                                   is-open="popup3.opend"
                                                   datepicker-options="dateOptions3"
                                                   close-text="关闭" alt-input-formats="altInputFormats"
                                                   close-text="关闭" clear-text="清空" current-text="今天">
                                            <span class="input-group-btn">
                                            <button type="button" class="btn btn-default btn-sm no-margins"
                                                    ng-click="openDatepicker3()">
                                                <i class="fa fa-calendar"></i>
                                            </button>
                                        </span>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">审核结束日期：</span>
                                            <input type="text" id="EndDate"
                                                   class="form-control" ng-readonly="true" ng-click="openDatepicker4()"
                                                   uib-datepicker-popup="{{format}}" ng-model="searchInfo.EndDate"
                                                   is-open="popup4.opend"
                                                   datepicker-options="dateOptions4"
                                                   close-text="关闭" alt-input-formats="altInputFormats"
                                                   ng-disabled="EndDateDisable"
                                                   close-text="关闭" clear-text="清空" current-text="今天">
                                            <span class="input-group-btn">
                                            <button type="button" class="btn btn-default btn-sm no-margins"
                                                    ng-click="openDatepicker4()"
                                                    ng-disabled="EndDateDisable">
                                                <i class="fa fa-calendar"></i>
                                            </button>
                                        </span>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">审核结果：</span>
                                            <select  class="form-control"  id="reviewerfinall" ng-model="searchInfo.reviewerfinall">
                                                <option value=""></option>
                                                <option value="0">未审核</option>
                                                <option value="1">已通过</option>
                                                <option value="2">未通过</option>
                                                <option value="3">银行处理中</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-sm-6 col-md-6 col-lg-3 col-lg-offset-3">
                                    <button type="submit" class="btn btn-sm btn-w-m btn-primary pull-right">
                                        查询
                                    </button>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <button type="button" class="btn btn-sm btn-w-m btn-info" ng-click="resetForm()">
                                        重置
                                    </button>
                                </div>
                            </div>

                            <div class="hr-line-dashed"></div>

                            <div class="table-responsive">
                                <table ng-table="AbnormalTable" class="table orderChangetable table-condensed table-striped table-hover table-bordered">
                                    <tr ng-repeat="row in $data">
                                        <td class="text-center" data-title="'平台订单号'" sortable="'orderId'">
                                             {{ row.orderId }}
                                        </td>
                                        <td class="text-center" data-title="'商户号'">
                                            {{row.merId | getMerIdAndName : merchants}}
                                        </td>
                                        <td class="text-center" data-title="'域名'">
                                            {{row.siteId | getValueByList : siteUrls : 'id' : 'siteUrl'}}
                                        </td>
                                        <td class="text-center" data-title="'支付方式'">
                                            {{ row.payMode }}
                                        </td>
                                        <td class="text-center" data-title="'支付类型'">
                                            {{ row.payType }}
                                        </td>
                                        <td class="text-center" data-title="'异常状态'">
                                            {{ row.type | getValueByList : exceptionstatus : 'firstValue' : 'name' }}
                                        </td>
                                        <td class="text-center" data-title="'订单金额'">
                                            {{ row.currency }} {{ row.orderAmount }}
                                        </td>
                                        <td class="text-center" data-title="'异常金额'">
                                            {{ row.currency }} {{ row.amount }}
                                        </td>
                                        <td class="text-center" data-title="'处理费'">
                                            {{ row.currency }} {{ row.fee }}
                                        </td>
                                        <td class="text-center" data-title="'交易时间'">
                                            {{ row.tradeTime | date: 'yyyy-MM-dd hh:mm:ss' }}
                                        </td>
                                        <td class="text-center" data-title="'申请时间'">
                                            {{ row.applicationTime | date: 'yyyy-MM-dd hh:mm:ss' }}
                                        </td>
                                        <td class="text-center" data-title="'申请人'">
                                            {{ row.applicant }}
                                        </td>
                                        <td class="text-center" data-title="'申请理由'">
                                            {{ row.reasons }}
                                        </td>
                                        <td class="text-center" data-title="'审核人'">
                                            {{ row.auditor }}
                                        </td>
                                        <td class="text-center" data-title="'审核时间'">
                                            {{ row.auditTime | date: 'yyyy-MM-dd hh:mm:ss' }}
                                        </td>
                                        <td class="text-center" data-title="'审核结果'">
                                            {{ row.statusName}}
                                        </td>
                                        <td class="text-center" style="max-width: 70px" data-title="'审核描述'">
                                            <div class="hidden-text" uib-tooltip="{{ row.remark }}">
                                                {{ row.remark }}
                                            </div>
                                        </td>
                                        <td class="text-center" data-title="'复核操作'">
                                            <div ng-show="row.statusName == '未审核'">
                                                <abnormal-locked></abnormal-locked>
                                            </div>
                                            <div ng-show="row.statusName == '已通过'">
                                                已审核
                                            </div>
                                            <div ng-show="row.statusName == '未通过'">
                                                已审核
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <my-pagination table-param="AbnormalTable"></my-pagination>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
